package com.neusoft.bizcore.activiti.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "wf_process_roles")
@org.hibernate.annotations.Table(appliesTo = "wf_process_roles", comment = "流程角色关联表")
public class ProcessRole extends AbstractModel {

    private static final long serialVersionUID = 1L;

    @NotBlank(message = "角色编码不能为空")
    @Length(max = 255, message = "角色编码不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '角色编码'")
    private String code;

    @ManyToOne
    private Process process;
}
